//
//  ViewController.m
//  SYMainProject
//
//  Created by biaowang on 2020/3/10.
//  Copyright © 2020 hlgrp. All rights reserved.
//

#import "ViewController.h"
#import "GeneratedPluginRegistrant.h"

@interface ViewController ()
@property(nonatomic, strong)FlutterEngine *flutterEngine;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor greenColor];
    FlutterDartProject *dart = [[FlutterDartProject alloc] init];
    self.flutterEngine = [[FlutterEngine alloc] initWithName:@"io.flutter" project:dart];
    [self.flutterEngine runWithEntrypoint:nil];
    [self.flutterEngine runWithEntrypoint:nil];
    self.view.backgroundColor = [UIColor whiteColor];
    
    // vc
    FlutterViewController *ctrl = [[FlutterViewController alloc] init];
    [ctrl setInitialRoute:@"ABC"];
    ctrl.view.backgroundColor = [UIColor whiteColor];
    ctrl.title = @"FlutterDemo";
    ctrl.view.frame = self.view.bounds;
    [self.view addSubview:ctrl.view];
    [self addChildViewController:ctrl];
}
@end
